package com.neu.questionnaireplus.service;

import com.neu.questionnaireplus.entity.Answerer;
import java.util.List;
import org.springframework.web.multipart.MultipartFile;

public interface AnswererService {

    Answerer queryAnswererByUsername(String username);

    /**
     * @Description: 查询所有答者,包括已经删除的
     * @Param: []
     * @return: java.util.List<com.neu.questionnaireplus.entity.Answerer>
     * @Author: ~FHX~ (:TSunS:)
     * @Date: 2022/10/30
     */
    List<Answerer> queryAnswerer();

    /**
     * @Description: 查询未被删除的答者
     * @Param: []
     * @return: java.util.List<com.neu.questionnaireplus.entity.Answerer>
     * @Author: ~FHX~ (:TSunS:)
     * @Date: 2022/10/31
     */
    List<Answerer> queryExistAnswerer();

    /**
     * @Description: 模糊查询答者
     * @Param: [answerer]
     * @return: java.util.List<com.neu.questionnaireplus.entity.Answerer>
     * @Author: ~FHX~ (:TSunS:)
     * @Date: 2022/10/30
     */
    List<Answerer> selectAnswererList(Answerer answerer);

    /**
     * @Description: 根据id查询答者并返回
     * @Param: [id]
     * @return: com.neu.questionnaireplus.entity.Answerer
     * @Author: ~FHX~ (:TSunS:)
     * @Date: 2022/10/30
     */
    Answerer queryAnswererByID(String id);

    /**
     * @Description: 插入一个Answerer进数据库
     * @Param: [answerer]
     * @return: boolean
     * @Author: ~FHX~ (:TSunS:)
     * @Date: 2022/10/30
     */
    boolean insertAnswerer(Answerer answerer);

    /**
     * @Description: 根据id更新答者
     * @Param: [answerer]
     * @return: boolean
     * @Author: ~FHX~ (:TSunS:)
     * @Date: 2022/10/30
     */
    boolean updateAnswerer(Answerer answerer);

    /**
     * @Description: 根据id删除答者
     * @Param: [id]
     * @return: boolean
     * @Author: ~FHX~ (:TSunS:)
     * @Date: 2022/10/30
     */
    boolean deleteAnswerer(String id);

    /**
     * @Description: 根据电话查询答者对象
     * @Param: [telnumber]
     * @return: com.neu.questionnaireplus.entity.Answerer
     * @Author: ~FHX~ (:TSunS:)
     * @Date: 2022/10/30
     */
    Answerer queryAnswererByPhone( String telnumber);

    /**
     * @Description: 通过密码登录
     * @Param: [username, password]
     * @return: boolean
     * @Author: ~FHX~ (:TSunS:)
     * @Date: 2022/10/30
     */
    boolean loginByPassword( String username, String password);

    /**
     * @Description: 通过用户名和回答验证密保
     * @Param: [username, answer]
     * @return: boolean
     * @Author: ~FHX~ (:TSunS:)
     * @Date: 2022/10/30
     */
    boolean checkSecurityQuestion( String username, String answer);

    /**
     * @Description: 查询该答者是否还有未答的试卷
     * @Param: [id]
     * @return: boolean
     * @Author: ~FHX~ (:TSunS:)
     * @Date: 2022/10/30
     */
    boolean hasDataRelation( String id);

    /**
     * @Description: 通过答者的username模糊查询答者
     * @Param: [username]
     * @return: java.util.List<com.neu.questionnaireplus.entity.Answerer>
     * @Author: ~FHX~ (:TSunS:)
     * @Date: 2022/10/30
     */
    List<Answerer> queryAnswererByName( String username);

    /**
     * @Description: 根据id禁用答者
     * @Param: [id]
     * @return: boolean
     * @Author: ~FHX~ (:TSunS:)
     * @Date: 2022/10/30
     */
    boolean forbiddenAnswerer( String id);

    /**
     * @Description: 根据id解禁答者
     * @Param: [id]
     * @return: boolean
     * @Author: ~FHX~ (:TSunS:)
     * @Date: 2022/10/30
     */
    boolean freeAnswerer( String id);

    /**
     * @Description: 根据答者群组状态做为依据修改答者信息
     * @Param: [answerer]
     * @return: boolean
     * @Author: ~FHX~ (:TSunS:)
     * @Date: 2022/10/31
     */
    boolean modifyAnswererInfo(Answerer answerer);

    /**
     * @Description:  根据答者群组状态做为依据逻辑删除答者信息
     * @Param: [answerer]
     * @return: boolean
     * @Author: ~FHX~ (:TSunS:)
     * @Date: 2022/10/31
     */
    boolean deleteAnswererInfo(Answerer answerer);
    
    /** 
    * @Description: 批量导入创建答者（文件格式：excel） 
    * @Param: [file] 
    * @return: java.util.List<com.neu.questionnaireplus.entity.Answerer> 
    * @Author: ~FHX~ (:TSunS:)
    * @Date: 2022/10/31 
    */
    List<Answerer> importFileToAnswerers(MultipartFile file);

    /**
    * @Description: 通过用户输入的inputStr验证码和真实验证码realStr进行比较，同时查询手机号是否存在，若存在且验证正确，登录放行
    * @Param: [phone, inputStr, realStr]
    * @return: boolean
    * @Author: ~FHX~ (:TSunS:)
    * @Date: 2022/11/2
    */
    boolean loginByPhone(String phone,String inputStr,String realStr);

    /**
    * @Description: 验证注册答者的验证码
     * @Param: [phone, inputStr, realStr]
    * @return: boolean
    * @Author: ~FHX~ (:TSunS:)
    * @Date: 2022/11/2
    */
    boolean checkRegisterStr(String phone,String inputStr,String realStr);

    /**
    * @Description: 验证重置密码的手机验证码
    * @Param: [phone, inputStr, realStr]
    * @return: boolean
    * @Author: ~FHX~ (:TSunS:)
    * @Date: 2022/11/2
    */
    boolean checkResetPwdStr(String phone,String inputStr,String realStr);

    /** 
    * @Description: 用户创建答者 
    * @Param: [answerer] 
    * @return: boolean 
    * @Author: ~FHX~ (:TSunS:)
    * @Date: 2022/11/4 
    */ 
    
    boolean createAnswerer(Answerer answerer);
    
    /** 
    * @Description: 在群组中加入答者 
    * @Param: [groupname, answererId] 
    * @return: boolean 
    * @Author: ~FHX~ (:TSunS:)
    * @Date: 2022/11/4 
    */ 
    boolean insertAnswererToGroup(String groupname,String answererId);
}
